/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.isd.inventario.web;

import java.io.InputStream;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;
import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;

/**
 *
 * @author ctrosch
 */
@ManagedBean
@ViewScoped
public class ControladorDescargaCatalogo {

    private StreamedContent catalogoCompleto;

    /** Creates a new instance of ControladorDescargaCatalogo */
    public ControladorDescargaCatalogo() {

        InputStream stream = ((ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext()).getResourceAsStream("/images/optimusprime.jpg");
        catalogoCompleto = new DefaultStreamedContent(stream, "image/jpg", "downloaded_optimus.jpg");

    }

    public StreamedContent getCatalogoCompleto() {
        return catalogoCompleto;
    }

    public void setCatalogoCompleto(StreamedContent catalogoCompleto) {
        this.catalogoCompleto = catalogoCompleto;
    }

}
